home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / languages / c / _desklibsm / h / coord < prev    next >
Encoding:
Text File  |  1993-05-26  |  1.3 KB  |  32 lines

  1.  
  2. #ifndef __dl_coord_h
  3. #define __dl_coord_h
  4. #ifndef __dl_core_h
  5. #include "Core.h"
  6. #endif
  7. #ifndef __dl_wimp_h
  8. #include "Wimp.h"
  9. #endif
  10. typedef struct
  11. {
  12.   wimp_rect  screenrect;
  13.   wimp_point scroll;
  14. } convert_block;
  15.  
  16. extern BOOL Coord_PointInRect(wimp_point *, wimp_rect *);
  17. extern BOOL Coord_RectContained(wimp_rect *, wimp_rect *);
  18. extern BOOL Coord_RectsOverlap(wimp_rect *, wimp_rect *);
  19. #define Coord_RectsIntersect(r1, r2) (Coord_RectsOverlap(r1, r2) && \
  20.                                      !Coord_RectContained(r1, r2) && \
  21.                                      !Coord_RectContained(r2, r1))
  22. extern void Coord_WindowOrigin(wimp_point *origin, convert_block *convert);
  23. #define Coord_XToScreen(X, C) (((X) - (C)->scroll.x) + (C)->screenrect.min.x)
  24. #define Coord_YToScreen(Y, C) ( ((Y) - (C)->scroll.y) + (C)->screenrect.max.y )
  25. extern void Coord_PointToScreen(wimp_point *point, convert_block *convert);
  26. extern void Coord_RectToScreen(wimp_rect *rect, convert_block *convert);
  27. #define Coord_XToWorkArea(X, C) (((X)-(C)->screenrect.min.x)+(C)->scroll.x)
  28. #define Coord_YToWorkArea(Y, C) (((Y)-(C)->screenrect.max.y)+(C)->scroll.y)
  29. extern void Coord_PointToWorkArea(wimp_point *point, convert_block *convert);
  30. extern void Coord_RectToWorkArea(wimp_rect *rect, convert_block *convert);
  31. #endif
  32.